![]() |
OpenCPort |
||||
Header: | Quickdraw.h | Carbon status: | Unsupported | |
Allocates space for and initializes a color graphics port.
void OpenCPort ( CGrafPtr port );
A pointer to a CGrafPort structure.
The OpenCPort function is analogous to OpenPort, except that OpenCPort opens a CGrafPort structure instead of a GrafPort structure.
Normally, your application does not need to call this function. The OpenCPort function is called by the NewCWindow and GetNewCWindow functions, as well as by the Dialog Manager when the appropriate color resources are present.
The OpenCPort function allocates storage for all the structures in the CGrafPort structure, and then calls InitCPort to initialize them. The InitCPort function does not allocate a color table for the PixMap structure for the color graphics port; instead, InitCPort copies the handle to the current device’s CLUT into the PixMap structure. The initial values for the CGrafPort structure are:
Initial value is 0 (the screen)
Initial value is a handle to the port’s PixMap structure.
Initial value is $C000.
Initial values is a handle to a GrafVars structure where black is assigned to the rgbOpColor filed, the default highlight color is assigned to the rgbHiliteColor field, and all other fields are set to 0.
Initial value is 0.
Initial value represents the low word of a Fixed number; in decimal, its initial value is 0.5.
Initial value is screenBits.bound (the boundary for the entire main screen).
Initial value is a handle to a rectangular region coincident with screenBits.bounds.
Initial value is a handle to the rectangular region (-32768, -32768, 32767, 32767).
Initial value is white.
Initial value is black.
Initial value is white.
Initial value is (0,0).
Initial value is (1,1).
Initial value is patCopy.
Initial value is black.
Initial value is black.
Initial value is 0 (visible).
Initial value is 0 (system font).
Initial value is plain.
Initial value is srcOr.
Initial value is 0 (system font size).
Initial value is 0.
Initial value is blackColor.
Initial value is whiteColor.
Initial value is 0.
Initial value is 0.
Initial value is NULL.
Initial value is NULL.
Initial value is NULL.
Initial value is NULL.
The OpenCPort function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
Not supported in Carbon. Not available in CarbonLib, but available when InterfaceLib 7.1 or later is installed. Exported by InterfaceLib 7.1 and later.
Carbon applications should use CreateNewPort and DisposePort to open and close graphics ports.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)